package com.behome.netty.netty_B.handler;

import com.behome.netty.netty_B.bean.ReBackPacket;
import com.behome.netty.netty_B.bean.TerminalBroadcastResult;
import io.netty.channel.ChannelHandlerContext;
import lombok.extern.slf4j.Slf4j;

/**
 * @author bh_ljy
 * @description: 终端播发结果上报处理类
 * @date: 2024/5/27 10:35
 */
@Slf4j
public class TerminalBroadcastResultHandler extends BusinessBHandlerBase {

    public TerminalBroadcastResultHandler(ChannelHandlerContext ctx, ReBackPacket msg, int type) {
        super(ctx, msg, type);
    }

    @Override
    public void resolve() {
        try {
            TerminalBroadcastResult terminalBroadcastResult = (TerminalBroadcastResult) this.msg.getBody().getBusinessReBack();
            String sourceCode = this.msg.getBody().getSourceCode();
            log.info(sourceCode + ":" + terminalBroadcastResult.toCHJsonString());
        } catch (Exception e) {
            log.error("发生异常", e);
        }
    }
}